package com.tosmart.jorm.util;

/**
 * @author tosmart@gmail.com
 */
public class StringUtil {

    /**
     * Signleton Pattern, only use a static
     * public method of class
     */
    private StringUtil() {
    }

    /**
     * To determine whether a string is Null,
     * or contains only empty characters
     *
     * @param str String instance
     * @return true or false
     */
    public static boolean isEmpty(String str) {
        return (str == null) || (str.trim().length() == 0);

    }

    /**
     * To determine whether a string is Not Null,
     * or contains Not only empty characters
     *
     * @param str String instance
     * @return true or false
     */
    public static boolean notEmpty(String str) {
        return !isEmpty(str);
    }
}